<h1>Proizvodi</h1>
<p>
    <strong><?= $this->Html->link("+ Novi proizvod", "/proizvodi/novi") ?></strong>
    | <?= $this->Html->link('Cene', '/cenovnici') ?>
</p>

<?= $this->Form->create('Filter', array('url'=>'/proizvodi' , 'class'=>'filter-form', 'type'=>'get')) ?>

	<?= $this->Form->label('name', 'Naziv:')?>
	<?= $this->Form->text('name', array('value'=>@$filter['name']))?>

	<?= $this->Form->label('product_type', 'Tip:')?>
	<?= $this->Form->select('product_type', $product_types, array('value'=>@$filter['product_type'], 'empty'=>'--SVI--'))?>

	<?= $this->Form->submit('Traži', array('div'=>false))?>
	<?= $this->Html->link('Poništi', '/proizvodi', array('class'=>'reset')) ?>
	
<?= $this->Form->end() ?>

<?= $this->element('entity_table', array(
	"columns" => array(
		"Naziv" => "Product.name",
		"Tip" => "ProductType.name",
		"Rok trajanja" => "Product.lifetime"
	),
	"rows" => $products,
	"row_id" => "Product.id",
	"delete_confirm" => "Da li želite da obrišete proizvod: {Product.name}?"
)) ?>
<?= $this->element('pagination') ?>